package day03;

import java.util.Scanner;

/**  
 * All rights Reserved, Designed .......
 * @Title:  HomeWork10.java   
 * @Package day03   
 * @Description:    实现接受班级10名学员Java成绩，根据平均分输出该班学员等级   
 * @author: wangjh     
 * @date:   2018年10月5日 下午12:22:43   
 * @version V1.0描述版本 
 * @Copyright: 2018 ....... Inc. All rights reserved. 
 * 注意：本内容仅限于......公司内部传阅，禁止外泄以及用于其他的商业目
 */ 
public class HomeWork10 {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.print("你们班上有点多少名学员：");
		int member = input.nextInt();
		double avg = 0;
		int sum = 0;
		int score = 0;
		for(int i =0;i<member;i++) {
			
			System.out.print("请输入第"+(i+1)+"名学员的Java成绩：");
			score = input.nextInt();
			sum+= score;
			avg = sum/member;
			if(score>100) {
				System.out.println("成绩无效！");
				break;
			}
			
			
		}
		if(avg>=90&&avg<=100&&score<=100) {
			System.out.println("该班学员的等级为：A");
		}else if(avg>=80&&avg<=89&&score<=100) {
			System.out.println("该班学员的等级为：B");
		}else if(avg>=70&&avg<=79&&score<=100) {
			System.out.println("该班学员的等级为：C");
		}else if (avg>=60&&avg<=69&&score<=100) {
			System.out.println("该班学员的等级为：D");
		}else if(avg>=0&&avg<=59&&score<=100){
			System.out.println("该班学员的等级为：E");
		}else {
			System.out.println();
		}
		
		

	}

}
